package top.kaoshanji.p2ch17c;

/**
 * 代码清单-p2ch17c-199页c：抽象装饰者
 * @author kaoshanji
 * ^_^
 * create time 2025/3/24 11:17
 */
public abstract class Decorator extends Component {

    private Component component = null;

    // 通过构造函数传递被装饰者
    public Decorator(Component component) {
        this.component = component;
    }

    // 委托给被修饰者执行
    @Override
    public void operate() {
        this.component.operate();
    }

}
